home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Picasso Interactive Demo / Data / Sequence / Sequence.Dxr / Internal_3_Sc. Frame 1.ls < prev    next >
Encoding:
Text File  |  1996-12-02  |  10.9 KB  |  280 lines

  1. on exitFrame
  2.   go(the frame)
  3. end
  4.  
  5. on idle
  6.   global gNbEtapesSequence, gNumEtapeSequence, gListeTempoEtape, gNumPisteNav, gTypeTempoEtape, gValeurTempoEtape, gLastRollSouris, gEntreeEtapeNavigation, gNumEtapeMax, gTimerDebutSon, gFlagTransition, gFlagSon, g_call_param, gClickVisite, gRefSequence, gTypeAccesSequence, gListeReperes, gCurseurPointerSeq, gCurseurLoupeInSeq, gCurseurDoigtSeq, gCurseurFlecheGaucheSeq, gCurseurFlecheDroiteSeq, gCurseurMainUpSeq, gNumSpriteVideo, gTypeSpriteVideo, gNumTexteSprite, gListeTimer, gPhraseCourante, gIndex, gTailleListe, gListeDescSpriteVideo, gFinAfficherEtape
  7.   if gTypeTempoEtape = "NoDelay" then
  8.     put "Tempo 'noDelay'..." && "(Timer:" && the timer & ")"
  9.     afficherEtapeSuivante()
  10.     exit
  11.   else
  12.     if gTypeTempoEtape = "Delai" then
  13.       if (the timer >= gValeurTempoEtape) and (gNumEtapeSequence < gNbEtapesSequence) then
  14.         put "Tempo 'Delai'" && gValeurTempoEtape && "(Timer:" && the timer & ")"
  15.         afficherEtapeSuivante()
  16.         exit
  17.       end if
  18.     else
  19.       if gTypeTempoEtape = "SynchroSon" then
  20.         if the ticks >= (gTimerDebutSon + gValeurTempoEtape) then
  21.           put "Tempo 'SynchroSon'..." && gValeurTempoEtape && "(Timer:" && the ticks - gTimerDebutSon & ")"
  22.           afficherEtapeSuivante()
  23.           exit
  24.         end if
  25.       else
  26.         if gTypeTempoEtape = "FinSon" then
  27.           put "Tempo 'FinSon'..."
  28.           repeat while soundBusy(1)
  29.             if the mouseDown then
  30.               exit repeat
  31.             end if
  32.           end repeat
  33.           afficherEtapeSuivante()
  34.           exit
  35.         else
  36.           if gTypeTempoEtape = "Navigation" then
  37.             if gEntreeEtapeNavigation = 1 then
  38.               positionnerFlechesNav()
  39.               put "Tempo 'Navigation'..." && "(Fleches:" && gValeurTempoEtape & ")"
  40.               if gNumSpriteVideo > 0 then
  41.                 puppetSprite(gNumSpriteVideo, 1)
  42.                 if gFinAfficherEtape = 0 then
  43.                   put "FALSE"
  44.                 else
  45.                   put "TRUE"
  46.                 end if
  47.                 set numsprite to getAt(gListeDescSpriteVideo, 1)
  48.                 set the member of sprite numsprite to member getAt(gListeDescSpriteVideo, 2)
  49.                 set the rect of sprite numsprite to getAt(gListeDescSpriteVideo, 3)
  50.                 updateStage()
  51.                 if gTypeSpriteVideo = "QT" then
  52.                   set the movieRate of sprite gNumSpriteVideo to 1
  53.                 else
  54.                   if gTypeAccesSequence = "Visite" then
  55.                     repeat with i = 1 to 545
  56.                       set the movieTime of sprite gNumSpriteVideo to i mod the duration of member the name of the member of sprite gNumSpriteVideo
  57.                       if the mouseDown then
  58.                         exit
  59.                       end if
  60.                       updateStage()
  61.                     end repeat
  62.                     updateStage()
  63.                     set gNumEtapeSequence to gNumEtapeSequence + 1
  64.                     set gFlagTransition to 1
  65.                     set gFlagSon to 1
  66.                     afficherEtape(gNumEtapeSequence)
  67.                   else
  68.                     repeat with i = 1 to 50
  69.                       set the movieTime of sprite gNumSpriteVideo to i
  70.                       updateStage()
  71.                     end repeat
  72.                     repeat with i = 50 down to 0
  73.                       set the movieTime of sprite gNumSpriteVideo to i
  74.                       updateStage()
  75.                     end repeat
  76.                   end if
  77.                 end if
  78.               end if
  79.             end if
  80.             if (gNumSpriteVideo > 0) and (gRefSequence = "C00") then
  81.               if (the movieTime of sprite gNumSpriteVideo > 1740) and (the memberNum of sprite 5 <> the number of member "C00BZ0" of castLib "Sequence") then
  82.                 puppetSprite(4, 1)
  83.                 puppetSprite(5, 1)
  84.                 set the member of sprite 4 to member "C00BZ0"
  85.                 set the loc of sprite 4 to point(46, 8)
  86.                 set the member of sprite 5 to member "C00BK9"
  87.                 set the loc of sprite 5 to point(434, 141)
  88.               end if
  89.             else
  90.               if (gNumSpriteVideo > 0) and (gRefSequence = "N40") then
  91.                 set gNumTexteSprite to 48
  92.                 puppetSprite(48, 1)
  93.                 set the ink of sprite gNumTexteSprite to 36
  94.                 set gIndex to getAt(gListeTimer, gPhraseCourante)
  95.                 set gTailleListe to count(gListeTimer)
  96.                 if the movieTime of sprite gNumSpriteVideo >= gIndex then
  97.                   set nomMembre to "All" & gPhraseCourante
  98.                   set the castNum of sprite gNumTexteSprite to the number of member nomMembre
  99.                   put nomMembre
  100.                   set Largeur to the width of member nomMembre
  101.                   set the locH of sprite gNumTexteSprite to (640 - Largeur) / 2
  102.                   set the locV of sprite gNumTexteSprite to 340
  103.                   updateStage()
  104.                   if (gPhraseCourante + 1) <= gTailleListe then
  105.                     set gPhraseCourante to gPhraseCourante + 1
  106.                     set gIndex to getAt(gListeTimer, gPhraseCourante)
  107.                     put "gIndex :" & gIndex
  108.                   end if
  109.                 end if
  110.               end if
  111.             end if
  112.             if gTypeAccesSequence = "Visite" then
  113.               put RETURN & "VISITE...." & RETURN
  114.               startTimer()
  115.               repeat while the timer < 180
  116.                 if the mouseDown then
  117.                   set gClickVisite to 1
  118.                   OwnPlayDone()
  119.                   exit
  120.                 end if
  121.               end repeat
  122.               if soundBusy(1) and (chars(gSonEnCours, 1, 3) = gRefSequence) then
  123.                 repeat while soundBusy(1)
  124.                   if the mouseDown then
  125.                     set gClickVisite to 1
  126.                     OwnPlayDone()
  127.                     exit
  128.                   end if
  129.                 end repeat
  130.               end if
  131.               if gNumEtapeSequence = gNbEtapesSequence then
  132.                 OwnPlayDone()
  133.                 exit
  134.               else
  135.                 afficherEtapeSuivante()
  136.               end if
  137.             end if
  138.             set rollSouris to GetRollSouris()
  139.             puppetSprite(gNumPisteNav + 1, 1)
  140.             if not voidp(rollSouris) then
  141.               set curseur to "curseurPointer"
  142.               if rollSouris <> gLastRollSouris then
  143.                 set the member of sprite (gNumPisteNav + 1) to member ("Nav" && gValeurTempoEtape && rollSouris)
  144.                 if rollSouris = "gauche" then
  145.                   set the loc of sprite (gNumPisteNav + 1) to point(573, 464)
  146.                 else
  147.                   if rollSouris = "retour" then
  148.                     set the loc of sprite (gNumPisteNav + 1) to point(598, 464)
  149.                   else
  150.                     if rollSouris = "droite" then
  151.                       set the loc of sprite (gNumPisteNav + 1) to point(624, 464)
  152.                     end if
  153.                   end if
  154.                 end if
  155.                 set the type of sprite (gNumPisteNav + 1) to 16
  156.                 set gLastRollSouris to rollSouris
  157.               end if
  158.             else
  159.               if gLastRollSouris <> EMPTY then
  160.                 if gTypeAccesSequence <> "Index" then
  161.                   cursor(-1)
  162.                 end if
  163.                 set the type of sprite (gNumPisteNav + 1) to 0
  164.                 set gLastRollSouris to EMPTY
  165.               end if
  166.             end if
  167.           end if
  168.         end if
  169.       end if
  170.     end if
  171.   end if
  172.   if curseur = "curseurPointer" then
  173.     cursor(gCurseurPointerSeq)
  174.   else
  175.     if gTypeAccesSequence = "Index" then
  176.       cursor(gCurseurLoupeInSeq)
  177.     else
  178.       if (gTypeSpriteVideo = "QTVR") and rollOver(gNumSpriteVideo) then
  179.         cursor(gCurseurMainUpSeq)
  180.       else
  181.         cursor(-1)
  182.       end if
  183.     end if
  184.   end if
  185. end
  186.  
  187. on mouseDown
  188.   global gLastRollSouris, gClickNav, gTypeAccesSequence, gNumEtapeSequence, gNumEtapeMax, gFlagTransition, gFlagSon, gNumSpriteVideo, gTypeSpriteVideo, gCurseurMainDown, gtypempoetape
  189.   if rollOver(gNumSpriteVideo) and (gTypeSpriteVideo = "QTVR") then
  190.     cursor(gCurseurMainDownSeq)
  191.     gestionQTVRMarc()
  192.   else
  193.     set gClickNav to gLastRollSouris
  194.     if (gLastRollSouris = EMPTY) and (gTypeAccesSequence = "Index") then
  195.       set gNumEtapeSequence to 1
  196.       set gNumEtapeMax to 1
  197.       set gFlagTransition to 1
  198.       set gFlagSon to 1
  199.       set gTypeAccesSequence to EMPTY
  200.       afficherEtape(gNumEtapeSequence)
  201.       put "GTYPETEMPOETAPEDOWN :" && gtypempoetape
  202.     end if
  203.   end if
  204. end
  205.  
  206. on mouseUp
  207.   global gLastRollSouris, gClickNav, gNumEtapeSequence, gNumPisteNav, gNbEtapesSequence, g_call_param, gFlagTransition, gFlagSon, gListePausesNavigation, gListeReperes, gNumEtapeMax, gTypeAccesSequence, gClickVisite
  208.   if gTypeAccesSequence = "Visite" then
  209.     put "Ici...."
  210.     set gClickVisite to 1
  211.     OwnPlayDone()
  212.   end if
  213.   if (gLastRollSouris = gClickNav) and (gLastRollSouris <> EMPTY) then
  214.     set gLastRollSouris to EMPTY
  215.     cursor(4)
  216.     if gClickNav = "retour" then
  217.       OwnPlayDone()
  218.     else
  219.       if gClickNav = "droite" then
  220.         if gNumEtapeSequence = gNbEtapesSequence then
  221.           OwnPlayDone()
  222.         else
  223.           if gNumEtapeSequence < gNumEtapeMax then
  224.             arreterVoixOff()
  225.             set posListeRepere to getPos(gListeReperes, gNumEtapeSequence)
  226.             set gNumEtapeSequence to getAt(gListeReperes, posListeRepere + 1)
  227.             set gFlagTransition to 0
  228.             set gFlagSon to 0
  229.           else
  230.             set gNumEtapeSequence to gNumEtapeSequence + 1
  231.             set gFlagTransition to 1
  232.             set gFlagSon to 1
  233.           end if
  234.           afficherEtape(gNumEtapeSequence)
  235.         end if
  236.       else
  237.         if gClickNav = "gauche" then
  238.           afficherEtapePrecedente()
  239.         end if
  240.       end if
  241.     end if
  242.   end if
  243. end
  244.  
  245. on keyUp
  246.   global gDebug, gFrappeSequence, gListeSequences, gPathBoot, gPathDelimitor, gNumEtapeSequence, gRefSequence, g_call_param
  247.   set gFrappeSequence to chars(gFrappeSequence, 2, 6) & the key
  248.   if gDebug = 1 then
  249.     set refSequence to chars(gFrappeSequence, 4, 6)
  250.     set valueCharUnivers to charToNum(char 1 of refSequence)
  251.     if valueCharUnivers < 97 then
  252.       set refSequence to numToChar(valueCharUnivers + 32) & chars(refSequence, 2, 3)
  253.     end if
  254.     if getOne(gListeSequences, refSequence) then
  255.       puppetSound(0)
  256.       repeat with i = 1 to 48
  257.         puppetSprite(i, 0)
  258.       end repeat
  259.       go(1)
  260.       set the fileName of castLib "Sequence" to the pathName & char 1 of refSequence & gPathDelimitor & "Seq_" & refSequence
  261.       set gRefSequence to refSequence
  262.       repeat with i = 1 to 48
  263.         puppetSprite(i, 0)
  264.       end repeat
  265.       initSCore()
  266.       startMovieCheat()
  267.     end if
  268.   else
  269.     if ((gFrappeSequence = "franck") or (gFrappeSequence = "sebast")) and (gDebug = 0) then
  270.       alert("Cheat mode")
  271.       set gDebug to 1
  272.     else
  273.       if gFrappeSequence = "neneck" then
  274.         set g_call_param to "N00"
  275.         go(1, gPathBoot & "Analyse")
  276.       end if
  277.     end if
  278.   end if
  279. end
  280.